<?php if (!defined ('BASEPATH')) exit ('No direct script access allowed');?>
<html>
<head>
<script type="text/javascript" src="<?php echo base_url();?>asset/javascript/jquery.js"></script>
</head>
	<title><?php echo $title;?></title>
	<link href="<?php echo base_url();?>asset/css/style.css" rel="stylesheet" type="text/css" />
	<link href="<?php echo base_url();?>asset/css/ui-lightness/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" />
<body>
	<div id="header"><h2>Selamat Datang</h2></div>
	<div id="content">
	<?php
	//tampilkan sidebar menu hanya jika user telah logn
	if($this->auth->is_logged_in()==TRUE):
	//level untuk user ini
	//$level = $this->session->userdata('level');
	//ambil menu dari database sesuai dengan level
	//$menu = $this->usermodel->get_menu_for_level($level);
	?>
	
	<div id="header-bar">
	<?php echo $this->session->userdata('NAMA');?> | <?php echo anchor('beranda/logout','Keluar');?>
	</div>
	<div id="sidebar-menu">
		<ul class="menu">
		<?php
		foreach($menu->result() as $row)
		{
			echo '<li>'.anchor($row->MENU_URI,$row->NAMA_MENU).'</li>';
			}
	?>
		</ul>
	</div>
	<?php
	//end dari pindahan dari index php
	endif;
	?>
	<?php
	//dynamic content load di sini
	echo $contents;
	?>
		<div class="clear"></div>
	</div>
	<div id="footer">Copyright &copy; 2011</div>
</body>
</html>